package com.nbsaas.boot.merchant.data.entity;

import com.nbsaas.boot.code.annotation.*;
import com.nbsaas.boot.jpa.data.entity.AbstractEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.Data;
import org.hibernate.annotations.Comment;

import java.util.Date;

@CreateByUser
@ComposeView
@Data
@FormAnnotation(title = "商家认证", model = "商家认证")
@Entity
@Table(name = "bs_merchant_certification")
@Comment("商家认证表")
public class MerchantCertification extends AbstractEntity {

    @Comment("商家ID")
    @FormField(title = "商家", sortNum = "1", type = InputType.select, required = true)
    private Long merchantId;

    @Comment("认证类型")
    @SearchItem(name = "certificationType", key = "certificationType", label = "认证类型")
    @FormField(title = "认证类型", sortNum = "2", grid = true, type = InputType.select, required = true)
    @Column(length = 20, nullable = false)
    private String certificationType;

    @Comment("认证名称")
    @SearchItem(name = "certificationName", key = "certificationName", label = "认证名称")
    @FormField(title = "认证名称", sortNum = "3", grid = true, required = true)
    @Column(length = 100, nullable = false)
    private String certificationName;

    @Comment("认证编号")
    @SearchItem(name = "certificationNumber", key = "certificationNumber", label = "认证编号")
    @FormField(title = "认证编号", sortNum = "4", grid = true)
    @Column(length = 100)
    private String certificationNumber;

    @Comment("认证图片")
    @FormField(title = "认证图片", sortNum = "5", type = InputType.image)
    @Column(length = 500)
    private String certificationImage;

    @Comment("认证文件")
    @FormField(title = "认证文件", sortNum = "6")
    @Column(length = 500)
    private String certificationFile;

    @Comment("发证日期")
    @FormField(title = "发证日期", sortNum = "7", type = InputType.date)
    private Date issueDate;

    @Comment("到期日期")
    @FormField(title = "到期日期", sortNum = "8", type = InputType.date)
    private Date expiryDate;

    @Comment("认证状态")
    @SearchItem(name = "status", key = "status", label = "认证状态")
    @FormField(title = "认证状态", sortNum = "9", grid = true, type = InputType.select)
    @Column(length = 20)
    private String status;

    @Comment("审核状态")
    @SearchItem(name = "auditStatus", key = "auditStatus", label = "审核状态")
    @FormField(title = "审核状态", sortNum = "10", grid = true, type = InputType.select)
    @Column(length = 20)
    private String auditStatus;

    @Comment("审核时间")
    @FormField(title = "审核时间", sortNum = "11")
    private Date auditTime;

    @Comment("审核人ID")
    @FormField(title = "审核人", sortNum = "12", type = InputType.select)
    private Long auditUser;

    @Comment("审核备注")
    @FormField(title = "审核备注", sortNum = "13", type = InputType.textarea)
    @Column(length = 1000)
    private String auditRemark;

    @Comment("备注")
    @FormField(title = "备注", sortNum = "14", type = InputType.textarea)
    @Column(length = 1000)
    private String note;
} 